package cn.iocoder.yudao.module.signature.appconnect.jaxrs;


import cn.iocoder.yudao.module.signature.appconnect.model.DeviceCreateRequest;
import cn.iocoder.yudao.module.signature.appconnect.model.DeviceUpdateRequest;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;

/**
 * A JAX-RS interface. An implementation of this interface must be provided.
 */
@Path("/devices")
public interface DevicesResource {

    /**
     * Register a new device for app development.
     *
     * @return The service response
     */
    @Path("")
    @POST
    @Produces({MediaType.APPLICATION_JSON})
    @Consumes({MediaType.APPLICATION_JSON})
    public Response createDevice(DeviceCreateRequest data);

    /**
     * Get information for a specific device registered to your team.
     *
     * @return The service response
     */
    @Path("/{deviceIdentifier}")
    @GET
    @Produces({MediaType.APPLICATION_JSON})
    public Response getDevice(@PathParam("deviceIdentifier") String deviceIdentifier,
                              @QueryParam("fields[devices]") List<String> fieldsDevices);

    /**
     * Find and list devices registered to your team.
     *
     * @return The service response
     */
    @Path("")
    @GET
    @Produces({MediaType.APPLICATION_JSON})
    public Response getDevices(@QueryParam("fields[devices]") List<String> fieldsDevices,
                               @QueryParam("filter[id]") List<String> filterId, @QueryParam("filter[name]") List<String> filterName,
                               @QueryParam("filter[platform]") List<String> filterPlatform,
                               @QueryParam("filter[status]") List<String> filterStatus,
                               @QueryParam("filter[udid]") List<String> filterUdid, @QueryParam("limit") Integer limit,
                               @QueryParam("sort") List<String> sort,
                               @QueryParam("cursor") String cursor);

    /**
     * Update the name or status of a specific device.
     *
     * @return The service response
     */
    @Path("/{deviceIdentifier}")
    @PATCH
    @Produces({MediaType.APPLICATION_JSON})
    @Consumes({MediaType.APPLICATION_JSON})
    public Response updateDevice(@PathParam("deviceIdentifier") String deviceIdentifier, DeviceUpdateRequest data);
}
